home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-18 | 2.0 KB | 76 lines | [TEXT/IGR0] |
- #include <Value Report>
-
- |************
- | Assuming the top graph contains data that has just been fitted to a built-in function
- | this macro adds or modifies a text box containing the fit parameters using the
- | value(error) notation.
- | The textbox is given the name 'fitres'.
- | Note that substitutions had to be made for () and <> in the popup menu due to the fact
- | that these are 'magic' characters in Apple menus.
- |
- Macro AppendBIFitResults(fitType,method)
- variable fitType=1
- Prompt fitType,"Fit type:",popup,"gauss;lor;exp;dblexp;sine;line;poly"
- variable method=4
- Prompt method,"reporting method:",popup,"b.bbb;b.bbb±s.sss;b.bbb {s.sss};b.bbb≤ss≥"
-
- Silent 1
- variable i,ilim
-
- if( (fitType<1) %| (fitType>7) )
- Abort "unknown fit type"
- endif
-
- String noteText="",tmpText
-
- i= 0; ilim= numpnts(W_sigma)
- do
- if( i==0 )
- sprintf tmpText,"K%d=\t",i
- else
- sprintf tmpText,"\rK%d=\t",i
- endif
- noteText += tmpText + MakeValueReportString(W_coef[i],W_sigma[i],method-1,"",1)
- i += 1
- while( i < ilim)
-
- Textbox/C/N=fitres noteText
- End
-
-
- |************
- | Assuming the top graph contains data that has just be fitted to a user function
- | this macro adds or modifies a text box containing the fit parameters using the
- | value(error) notation.
- | The textbox is given the name 'fitres'.
- |
- Macro AppendUserFitResults(fitCoefs,method)
- String fitCoefs
- Prompt fitCoefs,"Wave containing fit coefficients:",popup WaveList("*",";","")
- variable method=4
- Prompt method,"reporting method:",popup,"b.bbb;b.bbb±s.sss;b.bbb {s.sss};b.bbb≤ss≥"
-
- Silent 1
- variable i,ilim
-
- if( numpnts(W_sigma) != numpnts($fitCoefs) ) | at least a little error check
- Abort "incorrect fit coefficient wave"
- endif
-
- String noteText= "",tmpText
-
- i= 0; ilim= numpnts(W_sigma)
- do
- if( i==0 )
- sprintf tmpText,"K%d=\t",i
- else
- sprintf tmpText,"\rK%d=\t",i
- endif
- noteText += tmpText + MakeValueReportString($(fitCoefs)[i],W_sigma[i],method-1,"",1)
- i += 1
- while( i < ilim)
-
- Textbox/C/N=fitres noteText
- End
-
-